package com.cskaoyan._06intern;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/16 15:15
 **/

public class Demo2 {
    public static void main(String[] args) {
        String str = new String("h1") + new String("h2");
        String str2 = str.intern();
        String str3 = "h1h2";
        System.out.println(str == str2);
        System.out.println(str == str3);
        System.out.println(str2 == str3);
    }
}
